package com.guo.main.controller;

import com.guo.main.service.MainStageService;
import de.felixroske.jfxsupport.FXMLController;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import org.springframework.beans.factory.annotation.Autowired;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * MainStage Controller
 *
 * @author wangqingguo
 * @date 2018/4/28
 */
@FXMLController
public class MainStageController implements Initializable {
    @Autowired
    private MainStageService mainStageService;
    /***
     * webView组件
     */
    @FXML
    private WebView contentView;

    /***
     * 视图初始化
     * @param location 视图路径
     * @param resources 资源
     */
    @Override
    public void initialize(URL location, ResourceBundle resources) {
        System.out.println(mainStageService);
        WebEngine eng = contentView.getEngine();
        eng.load("http://www.baidu.com");
    }
}
